package cn.lili.modules.order.order.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.order.fallback.OrderFallback;
import cn.lili.modules.order.fallback.OrderFreeStatusLogFallback;
import cn.lili.modules.order.order.entity.dos.Order;
import cn.lili.modules.order.order.entity.dos.OrderFreeStatusLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 32312
 */
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.ORDER_SERVICE, contextId = "order-free-status-log", fallback = OrderFreeStatusLogFallback.class)
public interface OrderFreeStatusLogClient {


    /**
     * 订单编号查询
     *
     * @param sn 订单编号
     * @return 订单模型
     */
    @GetMapping("/feign/freeOrderStatus/query/{sn}")
    List<OrderFreeStatusLog> getBySn(@PathVariable String sn);

    /**
     * 保存保税仓订单状态记录
     */
    @PostMapping("/feign/freeOrderStatus/save")
    Boolean save(@RequestBody OrderFreeStatusLog orderFreeStatusLog);

    /**
     * 订单编号查询
     *
     * @param outTradeNo 订单编号
     * @param orderStatus 保税仓订单状态
     * @return 订单模型
     */
    @GetMapping("/feign/freeOrderStatus/getBySnAndOrderStatus")
    List<OrderFreeStatusLog> getBySnAndOrderStatus(@RequestParam String outTradeNo,@RequestParam String orderStatus);
}
